package com.example.springboot.excception;

import com.example.springboot.common.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 标题: HandlerException
 * 作者:  程序员子凡
 * 日期: 2024/1/24 10:16
 * 功能: 处理异常类
 */
public abstract class HandlerException {

    @ExceptionHandler
    @ResponseBody
    public Result<Object> ExcHandler(Exception e){
        return Result.error(e.getMessage());
    }

}
